<template>
  <div>
    {{result}}
  </div>
</template>
<script>
const obj = {
  list0: [
    { age: 24 }
  ],
  list1: [
    { test: 777 }
  ]
}

export default {
  data: () => ({
    result: []
  }),
  methods: {
    init () {
      let start = [
        {name: 'start'}
      ]
      var arr = [1, 2]
      let fetchList = []
      arr.map(async(item, index) => {
        let list = await this.fetch(index)
        fetchList = fetchList.concat(list)
      })
      let end = [
        {name: 'end'}
      ]
      this.result = []
      this.result = this.result.concat(start, fetchList, end)
    },
    fetch (index) {
      return new Promise((resolve, reject) => {
        let result = obj['list' + index]
        resolve(result)
      })
    }
  },
  created () {
    this.init()
  }
}
</script>
<style lang="scss" scoped>
</style>
